#include <reg51.h>


// RS R/W E
sbit E = P2^0;
sbit RW = P2^1;
sbit RS = P2^2;



void dely () {
	int i;
	for (i=0;i<3000;i++){}
		
	return;	
}

void WriteCMD(unsigned char x) {
	RS=0;RW=0;

	P0=x;
	E=1;
	dely();
	E=0;
}


void WriteDATA(unsigned char x) {
	RS=1;RW=0;

	P0=x;
	E=1;
	dely();
	E=0;
}

void LCDinit () {

	WriteCMD(0x01);
	WriteCMD(0x38);		
	WriteCMD(0x0f);	
	WriteCMD(0x06);	

}



void main () {


	
	char s[]= {"HappyNationalDay"};
	char name[]= {"Syh"};
	int i=0;
	LCDinit();
	for(i=0;i<14;i++) {
		WriteCMD(0x81+i);	
		WriteDATA(s[i]);	
	}
	
		i=0;
	
	for(i=0;i<sizeof(name)/sizeof(char);i++) {
		WriteCMD(0xc1+i);	
		WriteDATA(name[i]);	
	}
	
	
	
	
	while(1);

}